package com.example.tests;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;

import com.opera.core.systems.OperaDriver;

public abstract class Base {

	protected WebDriver driver;
	protected String Search1 = "Hello User!";
	protected String Search2 = "blabla";
	protected String Mail = "vitaliitest12@gmail.com";
	protected String Pass = "F6v32R3v";
	protected String Test;
	
	
	@BeforeSuite
	@Parameters({"browser"})
	public void setUp(@Optional("firefox") String  browser){
		if (browser.equals("firefox")){
			driver = new FirefoxDriver();
		} else
			if (browser.equals("chrome")){
			driver = new ChromeDriver();
		} else
			if (browser.equals("opera")){
			driver = new OperaDriver();
		} else if (browser.equals("IE")){
			driver = new InternetExplorerDriver();
		}
		
	}
	
	@AfterSuite
	public void close(){
		driver.quit();
	}
}
